package com.shisfish.controller;

import com.shisfish.domain.Test;
import com.shisfish.service.TestService;
import com.shisfish.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author shisfish
 * @date 2020/1/17
 */
@RestController
public class TestController {

    @Autowired
    TestService testService;

    @PostMapping(value = "/test")
    public ResultVO save(Test test) {
        return testService.save(test);
    }

    @DeleteMapping(value = "/test")
    public ResultVO del(Integer id) {
        return testService.del(id);
    }

    @PutMapping(value = "/test")
    public ResultVO updateGirl(Test test) {
        return testService.update(test);
    }

    @GetMapping(value = "/tests")
    public ResultVO findAll() {
        return testService.findAll();
    }

    @GetMapping(value = "/test")
    public ResultVO findById(@RequestParam Integer id) {
        return testService.findById(id);
    }

}
